package com.jsb.laundry.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jsb.laundry.model.entity.JsbPostLikes;
import com.jsb.laundry.model.entity.JsbPosts;

/**
* @author ching
* @description 针对表【jsb_post_likes(帖子点赞关系表)】的数据库操作Service
* @createDate 2023-08-09 14:06:04
*/
public interface JsbPostLikesService extends IService<JsbPostLikes> {
    /**
     * 点赞
     *
     * @param postId
     * @param userId
     * @return
     */
    int doPostLike(Integer postId, String userId);

    /**
     * 帖子点赞（内部服务）
     *
     * @param userId
     * @param postId
     * @return
     */
    int doPostLikeInner(String userId, Integer postId);

    /**
     * 分页获取用户收藏的帖子列表
     *
     * @param page
     * @param queryWrapper
     * @param favourUserId
     * @return
     */
    Page<JsbPosts> listLikePostByPage(IPage<JsbPosts> page, Wrapper<JsbPosts> queryWrapper,
                                        String favourUserId);
}
